<?php
class Poliza extends AppModel {

	var $name = 'Poliza';
	var $useTable = 'polizas';	
	var $validate = array(
		'id' => VALID_NOT_EMPTY,
		'no_poliza' => VALID_NOT_EMPTY,
		'vigencia' => VALID_NOT_EMPTY,
		'tipo_poliza' => VALID_NOT_EMPTY,
		'proveedor_id' => VALID_NOT_EMPTY,
		'vehiculo_id' => VALID_NOT_EMPTY,
	);	
	
	var $belongsTo = array(
		'Proveedor' => array('className' => 'Proveedor',
							'foreignKey' => '',
							'conditions' => '',
							'fields' => '',
							'order' => '',
							'counterCache' => ''),
		'Vehiculo' => array('className' => 'Vehiculo',
							'foreignKey' => '',
							'conditions' => '',
							'fields' => '',
							'order' => '',
							'counterCache' => ''),
	);

	function buscar($palabraClave, $campoTabla){
		$resultado = $this->query("SELECT * FROM polizas, vehiculos WHERE $campoTabla = '$palabraClave'");		
		return $resultado;		
	}
}
?>